package com.trkj.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the SENDMEDCINE_DRUGSTORE database table.
 * 
 */
@Entity
@Table(name="SENDMEDCINE_DRUGSTORE")
@NamedQuery(name="SendmedcineDrugstore.findAll", query="SELECT s FROM SendmedcineDrugstore s")
public class SendmedcineDrugstore implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="SENDMEDCINE_DRUGSTORE_ID")
	private long sendmedcineDrugstoreId;

	public SendmedcineDrugstore(long sendmedcineDrugstoreId, String sendmedcineName) {
		super();
		this.sendmedcineDrugstoreId = sendmedcineDrugstoreId;
		this.sendmedcineName = sendmedcineName;
	}

	@Column(name="SENDMEDCINE_ALLCOST")
	private BigDecimal sendmedcineAllcost;

	@Temporal(TemporalType.DATE)
	@Column(name="SENDMEDCINE_DATE")
	private Date sendmedcineDate;

	@Column(name="SENDMEDCINE_NAME")
	private String sendmedcineName;

	public SendmedcineDrugstore(long sendmedcineDrugstoreId, BigDecimal sendmedcineAllcost, Date sendmedcineDate,
			String sendmedcineName) {
		super();
		this.sendmedcineDrugstoreId = sendmedcineDrugstoreId;
		this.sendmedcineAllcost = sendmedcineAllcost;
		this.sendmedcineDate = sendmedcineDate;
		this.sendmedcineName = sendmedcineName;
	}

	//bi-directional many-to-one association to SendmedcineDrugstoreDetail
	@OneToMany(mappedBy="sendmedcineDrugstore")
	private List<SendmedcineDrugstoreDetail> sendmedcineDrugstoreDetails;

	public SendmedcineDrugstore() {
	}

	public long getSendmedcineDrugstoreId() {
		return this.sendmedcineDrugstoreId;
	}

	public void setSendmedcineDrugstoreId(long sendmedcineDrugstoreId) {
		this.sendmedcineDrugstoreId = sendmedcineDrugstoreId;
	}

	public BigDecimal getSendmedcineAllcost() {
		return this.sendmedcineAllcost;
	}

	public void setSendmedcineAllcost(BigDecimal sendmedcineAllcost) {
		this.sendmedcineAllcost = sendmedcineAllcost;
	}

	public Date getSendmedcineDate() {
		return this.sendmedcineDate;
	}

	public void setSendmedcineDate(Date sendmedcineDate) {
		this.sendmedcineDate = sendmedcineDate;
	}

	public String getSendmedcineName() {
		return this.sendmedcineName;
	}

	public void setSendmedcineName(String sendmedcineName) {
		this.sendmedcineName = sendmedcineName;
	}

	public List<SendmedcineDrugstoreDetail> getSendmedcineDrugstoreDetails() {
		return this.sendmedcineDrugstoreDetails;
	}

	public void setSendmedcineDrugstoreDetails(List<SendmedcineDrugstoreDetail> sendmedcineDrugstoreDetails) {
		this.sendmedcineDrugstoreDetails = sendmedcineDrugstoreDetails;
	}

	public SendmedcineDrugstoreDetail addSendmedcineDrugstoreDetail(SendmedcineDrugstoreDetail sendmedcineDrugstoreDetail) {
		getSendmedcineDrugstoreDetails().add(sendmedcineDrugstoreDetail);
		sendmedcineDrugstoreDetail.setSendmedcineDrugstore(this);

		return sendmedcineDrugstoreDetail;
	}

	public SendmedcineDrugstoreDetail removeSendmedcineDrugstoreDetail(SendmedcineDrugstoreDetail sendmedcineDrugstoreDetail) {
		getSendmedcineDrugstoreDetails().remove(sendmedcineDrugstoreDetail);
		sendmedcineDrugstoreDetail.setSendmedcineDrugstore(null);

		return sendmedcineDrugstoreDetail;
	}

}